function mpc = case22
%CASE22  Power flow data for 22 bus distribution system
%    Please see CASEFORMAT for details on the case file format.
%
%    Data from ...
%       M. Ramalinga Raju, K.V.S. Ramachandra Murthy, K. Ravindra,
%       Direct search algorithm for capacitive compensation in radial
%       distribution systems, International Journal of Electrical Power &
%       Energy Systems, Volume 42, Issue 1, November 2012, Pages 24-30
%       https://doi.org/10.1016/j.ijepes.2012.03.006

%% MATPOWER Case Format : Version 2
mpc.version = '2';

%% system MVA base
mpc.baseMVA = 10;

%% bus data
% bus_i  type  Pd  Qd  Gs  Bs  area  Vm  Va  baseKV  zone  Vmax  Vmin
mpc.bus = [
  1  3  0.0000  0.0000  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
  2  1  0.0168  0.0209  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
  3  1  0.0168  0.0209  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
  4  1  0.0338  0.0373  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
  5  1  0.0146  0.0125  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
  6  1  0.0105  0.0142  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
  7  1  0.0088  0.0117  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
  8  1  0.0144  0.0186  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
  9  1  0.0193  0.0259  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 10  1  0.0144  0.0186  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 11  1  0.0163  0.0195  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 12  1  0.0163  0.0195  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 13  1  0.0821  0.0717  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 14  1  0.0347  0.0301  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 15  1  0.0347  0.0301  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 16  1  0.0803  0.0701  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 17  1  0.0496  0.0478  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 18  1  0.0496  0.0478  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 19  1  0.0438  0.0389  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 20  1  0.0373  0.0360  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 21  1  0.0373  0.0360  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
 22  1  0.0310  0.0294  0.0000  0.0000  1  1  0  11.0  1  1.1  0.9
];

%% generator data
% bus  Pg  Qg  Qmax  Qmin Vg  mBase  status  Pmax  Pmin  Pc1  Pc2  Qc1min  Qc1max  Qc2min  Qc2max  ramp_agc  ramp_10  ramp_30  ramp_q  apf
mpc.gen = [
  1  0.0000  0.0000  999  -999  1.0000  100  1   999  0  0  0  0  0  0  0  0  0  0  0  0
];

%% branch data
% fbus  tbus  r  x  b  rateA  rateB  rateC  ratio  angle  status  angmin  angmax
mpc.branch = [
   1   2  0.03028099  0.01493388  0.00000000  999  999  999  0  0  1  -360  360
   2   3  0.00452066  0.00233058  0.00000000  999  999  999  0  0  1  -360  360
   2   4  0.04476033  0.02304959  0.00000000  999  999  999  0  0  1  -360  360
   4   5  0.01595041  0.00818182  0.00000000  999  999  999  0  0  1  -360  360
   5   6  0.10834711  0.05580165  0.00000000  999  999  999  0  0  1  -360  360
   6   7  0.00494215  0.00254545  0.00000000  999  999  999  0  0  1  -360  360
   6   8  0.02400826  0.01236364  0.00000000  999  999  999  0  0  1  -360  360
   4   9  0.06141322  0.03162810  0.00000000  999  999  999  0  0  1  -360  360
   9  10  0.00452066  0.00233058  0.00000000  999  999  999  0  0  1  -360  360
   9  11  0.05578512  0.02876860  0.00000000  999  999  999  0  0  1  -360  360
  11  12  0.00452066  0.00233058  0.00000000  999  999  999  0  0  1  -360  360
  11  13  0.03257851  0.01677686  0.00000000  999  999  999  0  0  1  -360  360
  13  14  0.08644628  0.04452893  0.00000000  999  999  999  0  0  1  -360  360
  14  15  0.00181818  0.00095868  0.00000000  999  999  999  0  0  1  -360  360
  14  16  0.00452066  0.00233058  0.00000000  999  999  999  0  0  1  -360  360
  16  17  0.02654545  0.01366942  0.00000000  999  999  999  0  0  1  -360  360
  17  18  0.00784298  0.00403306  0.00000000  999  999  999  0  0  1  -360  360
  17  19  0.04743802  0.02445455  0.00000000  999  999  999  0  0  1  -360  360
  19  20  0.01067769  0.00545455  0.00000000  999  999  999  0  0  1  -360  360
  20  21  0.00719835  0.00371901  0.00000000  999  999  999  0  0  1  -360  360
  20  22  0.04404132  0.02267769  0.00000000  999  999  999  0  0  1  -360  360
];
